/**
 * Created by wujo5 on 1/3/2018.
 */
var login = function(username,password,succ,fail){
  var username = username;
  var password = password;
  var resJson = {
    resultCode : '200',
    reason : 'success',
    error_code : '0',
    data:username
  };
  if(username == "admin" && password == "admin") {
    succ(resJson);
  }
  else if(username == "admin" && password !== "admin"){
    resJson.error_code = '401';
    resJson.reason = 'password error';
    resJson.resultCode = '401';
    resJson.data = "password error";
    fail(resJson);
  }
  else {
    resJson.error_code = '401';
    resJson.reason = 'account or password error';
    resJson.resultCode = '401';
    resJson.data = "password error";
    fail(resJson);
  }


}
module.exports.login = login;
